{include file="public/top"}
<article class="page-container">
    <form id="form-qbank-add" class="form-horizontal" role="form" action="" method="post"
          enctype="multipart/form-data">
        {:token()}
        {php}
        $setting=json_decode($ExamSetting->setting);
        $questions=$setting->questions;
        $time=$setting->time;

        {/php}
        <div class="row cl" style="padding-top:20px;margin-left:-40px;">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>试卷名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input class="input-text radius" type="text" name="qname" value="{$ExamSetting.qname}">
            </div>
        </div>
        <div class="row cl" style="padding-top:20px;margin-left:-40px;">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input class="input-text radius" type="text" name="time" placeholder="秒" value="{$time}">
            </div>
        </div>
        <div class="row cl" style="padding-top:20px;margin-left:-40px;">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>所属题库：</label>
            <div class="formControls col-xs-8 col-sm-9">
            <span class="select-box" style="width:150px;">
                <select name="qbank_id" class="select" size="1">
                    {volist name="bankList" id="cate"}
                        <option value="{$cate.bid}" {if condition="($cate.bid==$ExamSetting.qbank)" } selected{/if}>{$cate.bank_name}</option>
                    {/volist}
                </select>
            </span>
            </div>
        </div>
        {volist name="typeList" id="type"}
        <div class="row cl" style="padding-top:20px;margin-left:-40px;">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>{$type.type_name}：</label>
            <div class="formControls col-xs-8 col-sm-9">
            <span class="select-box" style="width:150px;">
                <select name="questions_q{$type.qtype}" class="select" size="1">
{php}
                    $q='q'.$type->qtype;

                    if(!array_key_exists($q,(array)$questions)){
                    echo  "<option value='0' selected>---</option>";
                    $q_now=0;
                    }else{
                    $q_now=$questions->$q;
                    }
                    if(!array_key_exists('score',(array)$setting)){
                        $s_now='';
                    }elseif(!array_key_exists($q,(array)$setting->score))
                    {
                            $s_now='';}
                            else{
                            $s_now=$setting->score->$q;
                            }
                    {/php}
                    {for start="0" end="20" step="1" name="i"}

                        <option value="{$i}" {if condition="($i==$q_now)" } selected{/if}>{$i}</option>
                    {/for}
                </select>

                <input name="score_q{$type.qtype}" class="input-text radius" type="text" placeholder="题目分值"
                       value="{$s_now}">

            </span>
            </div>
        </div>
        {/volist}

        <div class="row cl" style="padding-top:20px;margin-left:40px;">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
<script type="text/javascript" src="__ADMIN__/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
    });
</script>


<!--/请在上方写此页面业务相关的脚本-->
{include file="public/footer"}